package cn.itsource.order.mapper;

import cn.itsource.order.domain.OrderAdopt;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface OrderAdoptMapper extends Mapper<OrderAdopt> {


    @Update("update t_order_adopt set state = 1 where order_sn = #{orderSn}")
    void updateStateByOrderSn(String out_trade_no);

    @Select("select * from t_order_adopt where pet_id = #{petId} and state = 0")
    OrderAdopt findOrderByPetId(Long petId);

    @Select("select * from t_order_adopt where last_confirm_time <= #{minuteAgoTime} and state = 0")
    List<OrderAdopt> findOrderTimeBefore(String minuteAgoTime);
}
